--watch #实时监控app. js, when app.js file changes, PM2 automatically reload2. View process# PM2 List# PM2 Show 0 or # PM2 info 0 #查看进程详细信息, 0 is PM2 process ID3. Monitoring# PM2 Monit4. St
PM2 is a process manager for a node app with load Balancing. When you want to take your standalone code all the CPUs on the server, and ensure that the process is always alive, 0 seconds of overloading, PM2 is perfect, let's look at PM2 commonly used command usage introduction bar.
PM2 (source on GitHub) is an open s
and you can manage it using PM21. Start# PM2 Start App.js# PM2 Start app.js--name my-api #my-api for PM2 process name# PM2 start App.js-i 0 #根据CPU核数启动进程个数# PM2 start app.js--watch #实时监控app. js,
feature allows you to reload the code without losing the request connection. Note: only available for Web apps running in Node 0.11.x version running in cluster mode (default mode)
$ PM2 Reload All
PM2 list: Lists all the process information that is managed by PM2, and also shows how many times a process will be started because of unhandled exceptions.
, can show how long the program has been running , the memory size, it is so great! Terminating the program is also simple: PM2 stop lists all programs launched with PM2: PM2 list [[email protected] uops]$ PM2 list┌──────────┬────┬──────┬─────┬────────┬───────────┬────────┬─────────────┬──────────┐│app name│id│mode│pi
Getting started with PM2
Description
PM2 is a node process management tool that includes a complete set of feature installations , including daemons, monitoring, logging, etc.
NPM Install Pm2-g
Command
First, you have a node file that you can start
Const HTTP = require (' http ');
HTTP
. Createserver (function (req, res) {
res.writehead ({' Content-type
IntroducedPM2 is a module of the Nodejs application process manager with load balancing, similar to supervisor,forever for process management.First, Installation:Second, start:PM2 start app.js--name my-api #my-api for PM2 process namePM2 Start App.js-i 0 #根据CPU核数启动进程个数PM2 start App.js--watch #实时监控app. js, PM2 automatic
management tool that can be used in a production environment Nodejs, and it has a load balancer built in. It not only guarantees that the service will not be interrupted all the time, but also provides 0 seconds of reload function, as well as a series of other process management and monitoring functions. And it's very easy to use. Below I will share my use of the process, Nodejs application is an express 4.x based application, the name is Wolverine .InstallationEnvironment Checklist:
W
Use PM2 to manage nodejs processes and pm2nodejs Processes
Pm2 is a process manager for a Node application with the load balancing function.
When you want to use your independent code to take advantage of all the CPUs on all servers, and ensure that the process is always alive, 0 seconds of heavy load, PM2 is perfect.
It is very suitable for the IaaS structure, b
be used:PM2 start NPM--watch--name webpack-agent-run DevOK PM2 's routine also has some common directives, such as:To view the startup items you have used:PM2 ListRestart:PM2 Restart XXX (project name)Stop it:PM2 Stop XXX (project name)DeletePM2 Delete XXX (project name)If you do not remember, directly in the console input: PM2, the console will give the daily i
The PM2 is a process manager for a node app with load-balancing capabilities.PM2 is perfect when you want to take advantage of all of your standalone code on all the CPUs on the server and ensure that the process is always alive, with 0 seconds of overloading. It is ideal for IaaS architectures, but not for PAAs scenarios (which will then develop PAAs solutions).Note: SaaS, PAAs, and IaaS are cloud service models. SaaS Software-as-a-service, such as G
Today, sitting on the right side of the colleague suddenly delighted to say to me: Hey, recommend you a good thing, with PM2 try, than forever high-end. I have always lagged behind the forefront of fashion technology, I seriously answer: what? PM2.5 still so serious, PM2 came out again!If not all have been accustomed to my two, this atmosphere is really embarrassed for a while ~ ~ hehe ...First of all, how
decompression to complete, it is recommended to change the extracted directory to node, or other meaningful name, or node upgrade too quickly on the original basis of the upgrade but the file directory display version name does not match.3. Configure node to run globallyexport NODE_HOME=/file/software/nodeexport PATH=$NODE_HOME/bin:$PATH #找到下边这一行添加进去,记得你自己的路径搞对了。export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROLRestart it and try it, NODE,NPM can be enabled globally.Recommend the above
Tags: Successful concise method description option to implement child process generation EveWebsite::: https://pm2.io/doc/en/runtime/quick-start/Preface
Source: HTTPS://GITHUB.COM/UNITECH/PM2
The PM2 here are not atmospheric pollutants.
In fact, the PM2 is a process manager with a load-balanced node
Ubuntu 12.04 Server can install node JS using Apt-get mode, however, the version after installation is v0.6.12 version, if we want to use a new version of the following configuration:Apt-get Install python-software-propertiesapt-add-repository ppa:chris-lea/node.jsapt-get updateapt-get Install NodejsAfter the installation is complete, you can check the version and use the following command to view:[Email protected]: #node-vv0.10.28Next we need to install PM2
The DEVO.PS team's obsession with JavaScript is no secret; node. js as the server side, Angularjs as the client, in a way, our stack is built with it. We build static clients and restful JSON The API approach means that we run a lot of node. js, and I have to admit that although all of node. JS is awesome, it still makes us headache when we run it in a production environment. Its tools and best practices are still scarce compared to some more mature languages (imagine: monitoring, logging, Error
TODO:Node.js PM2 How to use
The PM2 is a process manager for a node app with load-balancing capabilities.
PM2 is perfect when you want to take advantage of all of your standalone code on all the CPUs on the server and ensure that the process is always alive, with 0 seconds of overloading.
1. Installing PM2
The PM2 is a process manager for a node app with load-balancing capabilities.PM2 is perfect when you want to take advantage of all of your standalone code on all the CPUs on the server and ensure that the process is always alive, with 0 seconds of overloading. It is ideal for IaaS architectures, but not for PAAs scenarios (which will then develop PAAs solutions).Note: SaaS, PAAs, and IaaS are cloud service models. SaaS Software-as-a-service, such as G
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.